<template>
  <div class="boxApikey">
    <!-- APP key 管理内容 -->
    <el-form label-width="80px">
      <el-form-item label="账户：">
        <el-input v-model="userName"></el-input>
      </el-form-item>
      <el-form-item label="App Key:">
        <el-input v-model="input"></el-input>
        <p class="appkey_p">
          App Key 是您个人认证信息，具有该账户完全的权限，请您妥善保管
        </p>
      </el-form-item>
    </el-form>
    <hr />
  </div>
</template>
<script>
import {
  getMyAppKey,
  getInfo
} from "@/utils/httpUtils";
export default {
  data() {
    return {
      input: "",
      userName:""
    };
  },
  mounted() {
    this.refreshBtn();
    this.userInfo();
  },

  methods: {
    userInfo() {
      getInfo().then((res) => {
        this.userName = res.username;
      });
    },
    // 刷新获取数据
    refreshBtn() {
      getMyAppKey().then((res) => {
        console.log(res, "刷新");
        if(res.code == 60030) {
          this.input = res.message
        }else {
          this.input = res.appKey;
        }
      });
    },
  },
};
</script>
<style  scoped>
.boxApikey{
  width: 50%;
  margin: 0 auto;
}
.appkey_p {
  padding: 8px 0;
  color: #0062b4;
}
</style>
